﻿using System;
using System.Collections.Generic;
using Manager;
using UnityEngine;

namespace Studio
{
	// Token: 0x02000494 RID: 1172
	public class OCICharMale : OCIChar
	{
		// Token: 0x17000305 RID: 773
		// (get) Token: 0x06001D22 RID: 7458 RVA: 0x000B9D44 File Offset: 0x000B7F44
		public ChaControl male
		{
			get
			{
				return this.charInfo;
			}
		}

		// Token: 0x06001D23 RID: 7459 RVA: 0x000B9D4C File Offset: 0x000B7F4C
		public override void OnDelete()
		{
			base.OnDelete();
			Singleton<Manager.Character>.Instance.DeleteChara(this.male);
		}

		// Token: 0x06001D24 RID: 7460 RVA: 0x000B9D64 File Offset: 0x000B7F64
		public override void LoadAnime(int _group, int _category, int _no, float _normalizedTime = 0f)
		{
			Dictionary<int, Dictionary<int, Info.AnimeLoadInfo>> dictionary = null;
			if (!Singleton<Info>.Instance.dicMaleAnimeLoadInfo.TryGetValue(_group, out dictionary))
			{
				return;
			}
			Dictionary<int, Info.AnimeLoadInfo> dictionary2 = null;
			if (!dictionary.TryGetValue(_category, out dictionary2))
			{
				return;
			}
			Info.AnimeLoadInfo animeLoadInfo = null;
			if (!dictionary2.TryGetValue(_no, out animeLoadInfo))
			{
				return;
			}
			bool flag = _group == 0 && _category == 0 && _no == 0;
			this.male.LoadAnimation(animeLoadInfo.bundlePath, animeLoadInfo.fileName, !flag);
			this.animatorInfo = new OCIChar.AnimatorInfo(this.male.animBody);
			if (_normalizedTime != 0f)
			{
				this.charAnimeCtrl.Play(animeLoadInfo.clip, _normalizedTime);
			}
			else
			{
				this.male.AnimPlay(animeLoadInfo.clip);
			}
			this.charAnimeCtrl.nameHadh = Animator.StringToHash(animeLoadInfo.clip);
			this.optionItemCtrl.LoadAnimeItem(animeLoadInfo, animeLoadInfo.clip, this.male.GetShapeBodyValue(0), base.oiCharInfo.animePattern[0]);
			this.isAnimeMotion = animeLoadInfo.isMotion;
			this.isHAnime = animeLoadInfo.isHAnime;
			if (animeLoadInfo.isHAnime)
			{
				if (this.animatorInfo.isHeight)
				{
					this.male.SetAnimatorParamFloat(this.animatorInfo.height, base.oiCharInfo.animeOptionParam[0]);
				}
				if (this.animatorInfo.isBreast)
				{
					this.male.SetAnimatorParamFloat(this.animatorInfo.breast, base.oiCharInfo.animeOptionParam[1]);
				}
				if (this.isAnimeMotion && this.animatorInfo.isMotion)
				{
					this.male.SetAnimatorParamFloat(this.animatorInfo.motion, base.oiCharInfo.animePattern[0]);
				}
				if (this.isAnimeMotion && this.animatorInfo.isStroke)
				{
					this.male.SetAnimatorParamFloat(this.animatorInfo.stroke, base.oiCharInfo.animePattern[1]);
				}
				this.charAnimeCtrl.isSync = animeLoadInfo.isBreastLayer;
				if (this.animatorInfo.isBreastLayer)
				{
					this.charAnimeCtrl.animator.SetLayerWeight(this.animatorInfo.breastLayer, (float)((!animeLoadInfo.isBreastLayer) ? 0 : 1));
				}
			}
			else
			{
				this.charAnimeCtrl.isSync = false;
			}
			this.charAnimeCtrl.nameHadh = Animator.StringToHash(animeLoadInfo.clip);
			base.oiCharInfo.animeInfo.Set(_group, _category, _no);
		}

		// Token: 0x06001D25 RID: 7461 RVA: 0x000B9FF8 File Offset: 0x000B81F8
		public override void SetClothesState(int _id, byte _state)
		{
			base.SetClothesState(_id, _state);
			this.male.SetClothesState((_id == 0) ? 0 : 11, _state);
		}

		// Token: 0x06001D26 RID: 7462 RVA: 0x000BA01C File Offset: 0x000B821C
		public override void SetClothesStateAll(int _state)
		{
			base.SetClothesStateAll(_state);
			this.male.SetClothesStateAll((byte)_state);
		}

		// Token: 0x06001D27 RID: 7463 RVA: 0x000BA034 File Offset: 0x000B8234
		public override void ChangeChara(string _path)
		{
			base.ChangeChara(_path);
			this.optionItemCtrl.height = this.male.GetShapeBodyValue(0);
		}

		// Token: 0x06001D28 RID: 7464 RVA: 0x000BA054 File Offset: 0x000B8254
		public override void SetVisibleSimple(bool _flag)
		{
			base.oiCharInfo.visibleSimple = _flag;
			Male male = this.male.human as Male;
			if (male)
			{
				male.SetSimpleDraw(_flag);
			}
		}

		// Token: 0x06001D29 RID: 7465 RVA: 0x000BA090 File Offset: 0x000B8290
		public override void SetSimpleColor(Color _color)
		{
			base.SetSimpleColor(_color);
			Male male = this.male.human as Male;
			if (male)
			{
				male.SetSimpleColor(_color);
			}
		}

		// Token: 0x06001D2A RID: 7466 RVA: 0x000BA0C8 File Offset: 0x000B82C8
		public override void SetVisibleSon(bool _flag)
		{
			base.SetVisibleSon(_flag);
			Male male = this.male.human as Male;
			if (male)
			{
				male.SetVisibleSon(_flag);
			}
		}

		// Token: 0x06001D2B RID: 7467 RVA: 0x000BA100 File Offset: 0x000B8300
		public override void LoadClothesFile(string _path)
		{
			base.LoadClothesFile(_path);
		}
	}
}
